package com.hejia.alauda.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hejia.alauda.utils.RateUtil;

/**
 * 金融包的每日收益的实体
 * @author paul
 *
 */
public class Interest extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7653595960872199609L;
	
	@Column
	private Financing financing;//对应的金融包
	
	@Column
	private User user;

	@Column
	private BigDecimal interest;//当日的利息
	
	@Column
	private BigDecimal income; //累计利息
	
	@Column
	private Date valueDate;//计息日
	
	@Column
	private Integer calculated; //是否已经计算过利息{0：未计算，1：计算过}
	
	/*=====================查询辅助================*/
	/** 当前记录是否提前一次性借款结算*/
	private boolean advanceRepay;
	
	/** 金融包名称*/
	private String name;
	
	/** 金融包ID*/
	@JsonIgnore
	@Column
	private Long financing_id;
	
	public Interest() {
		super();
		this.modifyDate = RateUtil.getDate();
	}

	public Financing getFinancing() {
		return financing;
	}

	public void setFinancing(Financing financing) {
		this.financing = financing;
	}

	public BigDecimal getInterest() {
		return interest;
	}

	public void setInterest(BigDecimal interest) {
		this.interest = interest;
	}

	public BigDecimal getIncome() {
		return income;
	}

	public void setIncome(BigDecimal income) {
		this.income = income;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Date getValueDate() {
		return valueDate;
	}

	public void setValueDate(Date valueDate) {
		this.valueDate = valueDate;
	}

	public Integer getCalculated() {
		return calculated;
	}

	public void setCalculated(Integer calculated) {
		this.calculated = calculated;
	}

	public boolean isAdvanceRepay() {
		return advanceRepay;
	}

	public void setAdvanceRepay(boolean advanceRepay) {
		this.advanceRepay = advanceRepay;
	}

	public Long getFinancing_id() {
		return financing_id;
	}

	public void setFinancing_id(Long financing_id) {
		this.financing_id = financing_id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
